package com.edu.exam.enums.examination;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 处理状态枚举
 */
@Getter
@AllArgsConstructor
public enum HandlingStatus {
    UNHANDLED("UNHANDLED", "未处理"),
    PENDING("PENDING", "待处理"),
    IN_PROGRESS("IN_PROGRESS", "处理中"),
    HANDLED("HANDLED", "已处理"),
    ESCALATED("ESCALATED", "已上报"),
    IGNORED("IGNORED", "已忽略"),
    RESOLVED("RESOLVED", "已解决"),
    FAILED("FAILED", "处理失败"),
    CANCELLED("CANCELLED", "已取消"),
    PENDING_REVIEW("PENDING_REVIEW", "待审核");

    private final String code;
    private final String description;

    public static HandlingStatus fromCode(String code) {
        for (HandlingStatus status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return UNHANDLED; // 默认返回未处理
    }
}